#ifndef _FLOWSIMFRMLISTENER_H
#define _FLOWSIMFRMLISTENER_H

#include "ExampleFrameListener.h"
#include "FlowSimGPU.h"
#include "FlowSim.h"

namespace FlowSim
{
  class FlowSimFrmListener : public ExampleFrameListener, public OIS::MouseListener, public OIS::KeyListener
  {
  public:
    FlowSimFrmListener(RenderWindow* win, Camera* cam, SceneManager* sceneMgr, MyFlowSimGpu* flowSim);

    bool frameStarted(const FrameEvent &evt);
    bool frameEnded(const FrameEvent &evt);
    
    //mouse listener
    bool mouseMoved(const OIS::MouseEvent &e);
    bool mousePressed(const OIS::MouseEvent &e, OIS::MouseButtonID id);
    bool mouseReleased(const OIS::MouseEvent &e, OIS::MouseButtonID id);
    
    //key listener
    bool keyPressed(const OIS::KeyEvent &e);
    bool keyReleased(const OIS::KeyEvent &e);

  protected:
    bool _mouseDown; //left mouse button was down last frame?
    bool _toggle; //time left until next toggle.
    bool _rotate; //the rotate constant
    bool _move; //the movment constant
    SceneManager* _sceneMgr; //the current scene manager.
    SceneNode* _camNode; //the camera scene node.
    //MyFlowSim* _flowSim; //the flow simulation.
    MyFlowSimGpu* _flowSim;
    bool _continue; //?

    void moveCamera(); //helper function to move the camera.
  };
}

#endif
